home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 21 / Mac Magazin and MacEasy Magazine CD - Issue 21.iso / Wissenschaft & Technik / yorick_docs folder / yorick-mac-Intro < prev   
Text File  |  1996-02-29  |  15KB  |  284 lines

  1. Introduction
  2. ------------
  3. Yorick is a tool for analyzing numerical data. It has an interpreter
  4. that uses a C-like language and can operate on entire arrays without
  5. any need for do loops over the array indices. Yorick has a file I/O
  6. package with the ability to conveniently read text files with
  7. columns of numbers. The file I/O package can easily be trained to
  8. read a wide variety of binary and text files, if the formatting
  9. rules for the file are known. Yorick has a 2D graphics package that
  10. includes polylines, contour plots, cell arrays, and filled mesh
  11. plots. The new 3D graphics package provides surface plots, slicing
  12. planes, and iso-surfaces.
  13.  
  14. Instructions to the unix version of yorick are typed in a command
  15. window, and yorick writes responses to the command window and draws
  16. plots in one or more graphics windows. The user interface for yorick
  17. is text input oriented by design - the easiest way to specify
  18. transformations to apply to data is usually some equation-like form.
  19. The Macintosh version has a somewhat more user  friendly interface,
  20. but it is still controlled via text commands.
  21.  
  22. Gist is a program that displays frames in binary CGM files written by
  23. yorick and other applications (e.g. ATC GKS, IDL). gist is
  24. particularly useful for making PICT files from a CGM file written by
  25. a Unix version of yorick. 
  26.  
  27. The performance of yorick on the Macintosh is good in comparison to 
  28. competing analysis tools. The PowerMac version delivers performance 
  29. comparable to a current low end Sun workstation for computation
  30. intensive tasks. The graphics performance on my PowerMac 7100 is
  31. about like a high end x-terminal, which is less than a low end
  32. workstation. The graphics performance should be better on a PCI
  33. based Mac (I have not had a chance to test this). 
  34.  
  35. The Macintosh version of Yorick was created by Steve Langer
  36. (shl@icf.llnl.gov) from the Unix version written by Dave Munro.
  37. This file contains some short notes about the Macintosh version, but
  38. it is in no way an introduction to yorick. To learn how to use yorick
  39. you will have to examine the files in the doc directory and run
  40. yorick. The first thing you should probably do is to print the "cheat
  41. sheets". These PostScript files summarize the yorick language and
  42. commands. If you have a copy of Adobe's ATM, you can print
  43. PostScript files using the SendPS utility. Once you have yorick
  44. running, one of the nice features is the help command. If you know
  45. that "plg" is the command to make a y versus x plot, but don't
  46. remember the arguments, type "help,plg". By paying attention to the
  47. "see also" functions, you can find out a great deal without needing
  48. to look at the manual.
  49.  
  50.  
  51. Installation
  52. ------------
  53. Yorick is distributed in several self-extracting archive files. There
  54. is a version that runs on any 68020, 68030, or 68040 Mac with a
  55. floating point chip (FPU), another version that runs on 68020, 68030,
  56. or 68040 Macs without an FPU (e.g. 68040LC), and a Power Mac version.
  57. There is also a PowerMac version of gist and a 68000 version that
  58. does not require an FPU. Each version of gist and yorick checks for
  59. the Mac hardware and software it requires and aborts if it is not
  60. found (it is possible that detection of old 68000 Macs does not
  61. work).
  62.  
  63. The include, startup, and gist directories must be in the same folder
  64. as the yorick application (they are organized this way in the files
  65. we distribute). If you frequently need to include files from 
  66. specific directories, add the directory to the yorick search path in
  67. your custom.i file (located in the yorick/include folder).
  68.  
  69. If you have MacBinary capability in your ftp program, download the
  70. "sea" file. If you are using a unix-like ftp, download the "hqx" file
  71. and use a program like UnStuffIt to decode the BinHex file. Once you
  72. have the "sea" file, double-click on it and it will automatically 
  73. split itself apart into the constituent files. 
  74.  
  75. NOTE: Yorick ships with a preferred memory allocation of 3-5 MB,
  76. depending on the target procesor. Most simple calculations (like
  77. operations on 1D arrays) should run just fine in the minimum 2 MB. The
  78. larger size is intended to permit reasonable 2D computations. You can
  79. increase the memory allocation if you are working on large 2D or 3D
  80. datasets.
  81.  
  82.  
  83. Macintosh Version
  84. -----------------
  85. The Macintosh version of yorick is very similar to the Unix version,
  86. and almost all of the yorick documentation should apply. The main
  87. difference between the Mac and unix versions of yorick is in the user
  88. interface. The unix version runs in a terminal window while the mac
  89. version includes a built in command window with command re-issue
  90. capabilities and text editor windows that can be used to prepare
  91. yorick programs. Another difference is that the Mac version can save
  92. any graphics window to a PICT file (as well as yorick's native CGM
  93. and Postscript formats).
  94.  
  95. The macyorick command window is closer to being a text editor than a
  96. dumb terminal window. The main thing to know about the command window
  97. is that when you press the return key, everything to the left of the
  98. cursor in the current line is passed to yorick as a command. If there
  99. is any selected text when the return key is pressed, the selected
  100. text is passed to yorick as a command. This last feature can be used
  101. to send several lines at a time to yorick. All yorick output will be
  102. sent to the command window. 
  103.  
  104. When you type a command or call the read function to get keyboard 
  105. input, macyorick first removes anything it recognizes as a prompt
  106. string from the start of the line and then passes the rest of the
  107. line. This usually works well, but it can be fooled if you do
  108. something like declaring a variable called cont and then try to
  109. evaluate the following expression: cont> 3 mac yorick will remove the
  110. "cont> " before processing the line. This is a consequence of prompt
  111. removal, not a bug. Don't use  prompt strings at the start of an
  112. input line ("read> ", "do> ", "cont> "). Don't set the prompt string
  113. for the read function to the name of one of your variables.
  114.  
  115. Yorick has simple text editor windows that can be used for examining
  116. ascii data files or preparing yorick input decks. An editor is
  117. created using the "New Editor" command in the file menu. Text editor
  118. windows have an "execute" button that causes the contents fo the
  119. editor to be read as if yorick had been given an include command. If
  120. you are creating a new file, the file must be saved before the
  121. execute button will work. 
  122.  
  123. When yorick detects an error while processing the commands in a file
  124. (even nested include files), it will open the offending file in a
  125. text editor and place the cursor on the bad input line (this behavior
  126. can be disabled). 
  127.  
  128. If you double-click in the Finder on a file of type 'TEXT' with a
  129. creator "York', yorick will be launched, it will set it's working
  130. directory to the directory where the file is located, and it will
  131. then open the file into a text editor window. To run the program,
  132. just click the execute button. 
  133.  
  134. The Macintosh version also supports the use of "command-period" to
  135. abort long running yorick calculations. Yorick only checks for
  136. command-period between interpreted commands and while writing to the
  137. command window. If you have started a matrix solve that will take an
  138. hour to complete, using command-period will not help, because it will
  139. not be checked until the matrix solve completes. This feature is
  140. turned on by default, but may be disabled in the preferences dialog
  141. in the edit menu.
  142.  
  143. Yorick and gist both have a preferences dialog that is reached from 
  144. the Edit menu. Graphics preferences in gist apply to the single
  145. graphics window. In yorick, graphics preferences can be set for
  146. future graphics windows from the edit menu or for an existing window
  147. using the preferences button in the window. gist has an option to
  148. select either yorick-style CGM files or CGM files made by ATC GKS. If
  149. you don't know what this means, stick with yorick CGM files.
  150.  
  151. Graphics
  152. --------
  153. The Macintosh version of yorick implements the full gist graphics
  154. package. Each graphics window has a button that saves the current
  155. plot as a PICT file, a button to redraw the window, and a button to
  156. set the preferences flags for graphics. The PICT file can be set up
  157. either to produce a high quality image when printed or in a form that
  158. will make it easier to edit the PICT file in Canvas, MacDraw, etc. 
  159.  
  160. macyorick includes the new 3D graphics functions found in the unix 
  161. version. These include surface plots, slicing planes, and
  162. isosurfaces. These functions use a drawing algorithm that is fast but
  163. may generate incorrect results for polygons that extend a long way
  164. into the screen. If you are plotting using a reasonably smooth grid,
  165. you should not see any problems. The new 3D package is easy to use,
  166. for a 3D package. The problem with 3D graphics is that you need to
  167. give depth cues on a 2D screen, and generating good depth cues is not
  168. always easy. Yorick includes functions to set the position of the
  169. light(s) illuminating the surfaces and to rotate objects in 3D.  Look
  170. at the examples in demo5.i and experiment with your own  favorite
  171. plots. This package will continue to evolve as we get more 
  172. experience with 3D graphics. If you have any comments, please contact
  173. us so we can consider your suggestions. 
  174.  
  175. There is another problem that occurs with color plots when you have
  176. an 8 bit deep screen. Yorick loads a color table of roughly 240
  177. colors and uses those in plotting to the screen. Yorick allows you to
  178. pick from a number of pre-defined color tables, or to create your
  179. own. This allows you to produce striking cell arrays or filled 
  180. meshes on an 8 bit screen. The problem is that if you save the plot
  181. in a PICT file, any Mac program that loads the PICT file is unlikely
  182. to be using the same color table as yorick used in creating the
  183. image. The Mac will do the best job of displaying the image that it
  184. can given the current color table, but a lot of "banding" may show up
  185. in the image. The only way to fix this, with an 8 bit screen, is to
  186. load the same color table into the other Mac program as was used by
  187. yorick (non-trivial). HOWEVER, all of the color information is still
  188. present in the file, so the colors will show up properly on a color
  189. printer. This problem should not be noticeable on a 16 or 24 bit
  190. "true color" screen. 
  191.  
  192. macyorick supports yorick's animated graphics mode. In the normal
  193. graphics mode, everything appears on the screen as it is drawn. In
  194. animation mode, the whole plot is drawn in an offscreen pixmap and
  195. then copied to the screen all at one time. The result is that in
  196. animation mode, the transition between successive pictures is smooth.
  197. Animation mode is particularly useful in viewing the results of a 
  198. time dependent simulation. The simulation might have saved its
  199. results in a file, or the simulation might actually be run directly
  200. by yorick (see demo2.i for an example). Run demo3.i for an
  201. introduction to animation mode. 
  202.  
  203. Yorick can write plots to binary CGM files. The CGM file was
  204. originally developed for use on mainframe computers, and the standard
  205. is showing its age in some respects. One of the key problems is that
  206. there is no defined way to specify the exact font you desire in a CGM
  207. file. The result is that the program that wrote the CGM file can
  208. usually display it exactly, but other programs (e.g. Canvas) only
  209. produce an approximate rendition. My suggestion is that you use CGM
  210. files as places to store a group of related images (the CGM file
  211. could even be written on a Unix workstation). When you need to use an
  212. image in another Mac program, load the CGM file into the Macintosh
  213. version of gist (a CGM file browser) and save the desired frame as a
  214. PICT file. 
  215.  
  216.  
  217. Known Bugs and Missing Features
  218. -------------------------------
  219. 0) Yorick has been heavily tested on Unix workstations for a couple
  220. of years now and has been available on the Macintosh since late in
  221. 1994. It has been used for a wide variety of production calculations,
  222. but we still find several bugs a year.  The bugs don't prevent us
  223. from using yorick, and  are about what should be expected from a code
  224. of this complexity.  The Mac version of yorick is roughly as reliable
  225. as the unix version.  The core code is the same as for the unix
  226. version, so  any Mac specific bugs are most likely to be in the
  227. graphics package or the user interface. As a new yorick user,  your
  228. problems are most likely to stem from giving yorick the wrong
  229. command, or possibly from asking yorick to do something that will
  230. take forever. Look at the examples and start with simple problems,
  231. and things should go pretty smoothly.
  232.  
  233. 1) If your CGM files wind up in pure black and white, try using the
  234. "dump=1" option on the hcp_file command. The default behavior is to
  235. dump a gray scale file on the theory that most printers are black and
  236. white. There is some reason to think that the default should be to
  237. dump the color table, but for now you need to explicitly dump it.
  238.  
  239.  2) PICT files should have proper colors, but programs like MacDraw
  240. and Canvas will often fail to display the full range of colors on 8
  241. bit screens. This happens because they are using a color table that
  242. does not match the one originally used by yorick. The proper colors
  243. should show up on 16 and 24 bit screens, and will always be OK on
  244. color printers.
  245.  
  246. 3) The Mac version of yorick doesn't have an "interrupt key" like the
  247. control-C on unix versions, which can interrupt at an arbitrary point
  248. in the program. Macyorick instead checks for the command-period key
  249. when it sends a line of output to the command window and at the start
  250. of every interpreted instruction. Interrupting macyorick works well
  251. if you are doing a complicated interpreted calculation, but it will
  252. not work if you have told yorick to solve a 1000x1000 matrix or some
  253. other single operation that will take a very long time. command
  254. period detection is turned on by default.
  255.  
  256. 4) There is always a chance that yorick will cause your Mac to lock
  257. up. Yorick checks for out of memory conditions, but it can't help if
  258. a toolbox routine runs out of memory. The first thing to check is
  259. thus whether the problem goes away when you increase the memory
  260. allocation for yorick. If it is not a memory problem and you can find
  261. a simple way to repeat the problem, I would like to know what it is
  262. so I can try to fix it. If your Mac locks up after hours of use and
  263. lots of number crunching, I won't be able to reproduce your problem,
  264. so I am unlikely to be able to fix it. 
  265.  
  266. 5) The save window size button in the preferences dialog does not work
  267. due to problems with the FaceIt library. I hope to fix this in a future
  268. version.
  269.  
  270.  
  271. Source Code for Mac Yorick
  272. --------------------------
  273. The Macintosh version of yorick was built using the FaceIt
  274. package from FaceWare, 1310 N. Broadway, Urbana, Illinois, 61801,
  275. (217) 328-5842, faceware@aol.com. This package is no longer 
  276. under development, and at some future date I hope to convert to 
  277. the use of either the Symantec or Metrowerks class library. 
  278. The source code for yorick is available if you wish to build a 
  279. custom version incorporating your own compiled routines (don't 
  280. bother compiling your own routines until you are sure that an 
  281. interpreted version with array syntax is too slow). To build a 
  282. Macintosh version, you will need to get a copy of FaceIt, and 
  283. then request the Macintosh source from me. 
  284.